function closeAlertWindow(){
	$("#can").empty();//清空对话框div
}

/*function get_img(){
	 (function() {
		console.log("get_img");
		var img_code = $("#key_img");
		$.ajax({
			url:"earnImg.do",
			dataType: 'json',
	        contentType : "application/json",
	        type: "get",
	        async:true,
	        success: function(data) {
	        	//var img = successJson.img;
	        	alert("成功");
	        	img_code.attr("src","data:image/png;base64,"+data);
	        }
		})
	 })();
}*/

function earn_img(){
	$("#key_img").attr("src","earnImg.do?dt="+new Date().getTime());
}

function alert_log_in(){
	closeAlertWindow();
	$("#can").load("alert/alert_log_in.html",function(){
		$(this).children().show();
		earn_img();
	});
	//get_img();
	//the server responded with a status of 405 (Method Not Allowed)  service方法里面调用了父类构造
}

function alert_regist(){
	closeAlertWindow();
	$("#can").load("alert/alert_regist.html",function(){
		$(this).children().show();
		earn_img();
	});
}